package com.tank;

import com.tank.common.Dir;
import com.tank.config.TankContext;
import com.tank.model.EnemyTank;

/**
 * 启动类
 *
 * @author chenwb
 * @since 2024/1/21 12:54
 */
public class TankApplication {
    public static void main(String[] args) {
        // 创建一个坦克
        TankFrame tankFrame = new TankFrame();
        for (int i = 0; i < 10; i++) {
            tankFrame.addEnemyTank(new EnemyTank(50 + i * 100, 100, Dir.DOWN));
        }
        TankContext.setTankFrame(tankFrame);

        // new Thread(() -> AudioFactory.getInstance().getWarAudio().loop()).start();

        while (true) {
            tankFrame.repaint();
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
